/**************************************************************************************
*
*	Copyright (C) 2009 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	Array.h
*
*	Description -	Array class.
*
*	Comments	-	TODO: Re-Implement iterator!!!!.
*					
*	Modification History:
*			Name			   Date					Description
*			CodeSushi	-	10/29/2009	-	Creation of vector class
*			CodeSushi	-	11/1/2009	-	Vector Iterator <- That's is not how you implement one...
**************************************************************************************/

#ifndef _PSX_ARRAY_H_
#define _PSX_ARRAY_H_

#include "PulseSTD.h"

namespace Pulse
{

	template < typename T >
	class Array
	{
	public:
		
		/* Vector Functions */
		Array( VOID );
		Array( SIZE_T size );
		Array( const Array &vec );
		~Array( VOID );

		SIZE_T GetSize( VOID );
		const SIZE_T GetSize( VOID ) const;
		SIZE_T GetCapacity( VOID );
		T & GetHead( VOID );
		const T & GetHead( VOID ) const;
		T & GetTail( VOID );
		const T & GetTail( VOID ) const;

		T & operator [] ( SIZE_T index );
		const T & operator [] ( SIZE_T index ) const;

		VOID Clear( VOID );

		VOID PushBack( const T &obj );
		VOID PopBack( VOID );
		const Array & operator = ( const Array  &rhs );
		VOID Resize( SIZE_T size );
		VOID Reserve( SIZE_T capacity );

		typedef T * Iterator;
		typedef const T * ConstIterator;

		Iterator IteratorBegin( void );
		ConstIterator IteratorBegin( void ) const;
		Iterator IteratorEnd( void );
		ConstIterator IteratorEnd( void ) const;

	private:

		SIZE_T	m_size;
		SIZE_T	m_capacity;
		T		*m_pArray;

	};
};

#include "Array.inl"

#endif /* _PSX_ARRAY_H_ */
